<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="color-scheme" content="light dark">
    <title>PerfView Videos</title>
    <style>
        :root[data-theme="light"] {
            color-scheme: light;
        }

        :root[data-theme="dark"] {
            color-scheme: dark;
        }

        body {
            font-family: Segoe UI,SegoeUI,Segoe WP,Helvetica Neue,Helvetica,Tahoma,Arial,sans-serif;
            font-weight: 400;
            text-rendering: optimizeLegibility;
            -webkit-font-smoothing: antialiased;
        }

        hr {
            border-top: 3px double gray;
        }
    </style>
</head>
<body>

    <h1>PerfView Videos</h1>
    <p>
        The documentation built into PerfView is intended to be sufficient to tell you what
        you need to know in order to use the tool effectively.   However it is still valuable
        to have someone actually demonstrate the tool in action.    Here we present a set of tutorial videos that will present the basics.
    </p>
    <p>
        Each tutorial is designed to be short and cover only one topic. This allows you
        to pick and choose the topics of interest and skip what is not currently
        relevant easily. Also keep in mind the Ctrl-Shift-G (go faster) and Ctrl-Shift-N
        (Normal speed) feature of Windows Media player. This can help you watch the
        videos even faster.&nbsp;
    </p>
    <h2>Getting the Latest PerfView Videos</h2>
    <p>
        The videos listed below are those that existed at the time this version of PerfView was released.&nbsp;&nbsp; Since more videos are being added all the time, you should check the <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/">PerfView Tutorial Series</a>
        for the latest additions.&nbsp;
    </p>
    <h2>Getting PerfView</h2>
    <ol>
        <li>
            <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/0-getting-perfview">Getting PerfView from the Internet</a> -(2 min) -
            PerfView is REALLY easy to get.   If you have an internet connection you are about 4 clicks
            away from running perfView.   This QUICK video shows you how.
        </li>
    </ol>

    <h2>Time Investigations</h2>
    <p>
        The most common kind of performance investigation is optimizing time.   For this case, the PerfView has the 'Run' and 'Collect'
        command that will generate ETL (event trace log) files that are used for analysis.
    </p>
    <h3>Collecting Data for Investigations into Time </h3>
    <ol>
        <li>
            <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/1-collecting-data-run-command">Collecting Data with the PerfView &#39;Run&#39; Command</a> -(5 min) - Before you can
            investigate, you first have to collect. If your scenario can be run from the
            command line easily, you shoud use the &#39;Collect -&gt; Run&#39; command to collect the
            data. You can be finished collecting in less than a minute.
        </li>
        <li>
            <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/11-data-collection-server-scenarios">Collecting Data For Services</a> -(7 min) - When investigating services it is convinient
            to explicitly start and stop the trace.   It is also very common to want to collect data on
            one machine (often by asking someone else to collect the data) and then analyze it on another
            machine.   This video shows you some of your options for server-scenario data collection.
        </li>

    </ol>

    <h3>CPU Investigations.&nbsp; </h3>
    <p>
        <span>
            The most common kind of Time investigation is investigating high CPU usage
        </span>
    </p>
    <ol>
        <li>
            <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/2-simple-cpu-performance-investigation">A Simple CPU Investigation</a> (16 min) - Typically the first investigation you
            do is to check on CPU usage. This totorial is longer than most, but that is
            because it covers a lot of important &#39;background&#39; information need to be a
            productive investigator. If you watch only one video, this should be it.
        </li>

        <li>
            <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/3-resolving-symbols">Symbol Resolution</a> (5 min) -  By default Perfview only resolves 'easy'
            symbols (which include many managed methods).  If you need symbol (.pdb)
            files to resolve addresses to names you typically need to ask PerfView to
            do this explicitly.  This video shows you what the process is where PerfView
            looks by default, and where to start if you have problems getting symbols.
        </li>
        <li>
            <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/4-grouping-folding">Grouping And Folding</a> (13 min) -
            Something that sets PerfView apart from most other profiling tools is its
            ability to hide a large amount of irrelevant detail while also allowing you to
            have high detail on the parts of the application that matter to you.&nbsp;&nbsp;
            This magic is done by the grouping and folding features (GroupPats and Fold*
            textboxes).&nbsp;&nbsp; This video talks demonstrates this power and gives you
            the basics you need in order to use it effectively.&nbsp;&nbsp;
        </li>
        <li>
            <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/5-drilling-into">Drilling Into Cost</a> (6 min) -
            In the first phase of an investigation you use the grouping and folding features
            to reduce the number of nodes you are considering.&nbsp; Your goal is to create
            nodes that are &#39;sematically meaninful&#39; which account for a substantial part of
            the cost.&nbsp; After this grouping is complete, you know what to look at, the
            question is &#39;How?&#39;.&nbsp;&nbsp; If you were to ungroup, the problem is that are
            effectively undoing the work you just did.&nbsp;&nbsp; Instead you want pick the
            samples from JUST ONE ENTRY, and &#39;Drill into&#39; those.&nbsp; Once these samples
            are in their own window, you can safely ungroup without unrelated calls that you
            are not interested in skewing the statistics.&nbsp;&nbsp; This view shows you
            how easy it is to do this.
        </li>

    </ol>

    <h3>Wall Clock Time Investigations.&nbsp; </h3>
    <p>Typically if you aredoing a time investigation, you are concerned about wall clock time (not CPU time).&nbsp;&nbsp; Thus you can argue that wall clock time investigations are more important that CPU investigations.&nbsp; However wall clock time is more harder to investigate because every thread in your process has its own wall clock time, and what you are intersted in is the CRITICAL PATH among these threads.&nbsp;&nbsp; CPU is nice because it TENDS to be on the critical path (even if the flow of control hops from thread to thread), which means ANY CPU time is probably important.&nbsp; This is NOT true for wall clock time and is part of what makes it harder to analyze.&nbsp;&nbsp;&nbsp; These videos walk you through what you need to know in order to do a successful wall clock time investigation.&nbsp; </p>
    <ol>
        <li><a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/tutorial-12-wall-clock-time-investigation-basics">Wall Clock Time Investigation Basics</a> (16 min) - This video walks through a wall clock investigation on a very simple scenario (a disk bound sequential program).&nbsp;&nbsp; It covers how you should collect the data (the Thread Time checkbox), as well as using a method frame to isolate time to a particular thread and time interval for analysis.</li>
        <li><a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/tutorial-13-leveraging-tasks-make-sense-of-parallelasynchronous-programs">Leveraging Tasks make sense of Parallel/Asynchronous programs</a> (16 min) - This video walks through a more complex scenario where operations are happening in parallel and shows you that if you used System.Diagnostics.Threading.Tasks to do the parallel activity, PerfView can &#39;roll up&#39; the costs of the paralllel/async activity in a way that allows parallel/async programs to be analyzed like the simpler sequential case. </li>
        <li><a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/tutorial-14-investigating-wall-clock-responce-time-in-aspnet-scenarios">Investigating Wall Clock Response Time of ASP.NET scenarios</a>&nbsp;(16 min) In this video we show how to analyze the wall clock response time of an ASP.NET application.&nbsp; I also discuss this scenario in<a data-mce-href="http://blogs.msdn.com/b/vancem/archive/2012/11/28/video-wall-clock-time-analysis-of-asp-net-applications-using-perfview.aspx" href="http://blogs.msdn.com/b/vancem/archive/2012/11/28/video-wall-clock-time-analysis-of-asp-net-applications-using-perfview.aspx"> this blog entry</a>.</li>
    </ol>
    <h3>The PerfView Event Viewer</h3>
    <p>
        Fundamentally an ETW data file is a time order list of events.&nbsp;&nbsp; Some
        of the views (like the &#39;CPU Stacks&#39; view) will regroup these events based on the
        stack traces that are attached to events, but by necessity these views throw
        away much of the data in that was logged with the event.&nbsp;&nbsp; Thus there
        are times when you want to see the &#39;raw&#39; view, where you see a time ordered list
        of events where each event can have a particular event-specific payload.&nbsp;&nbsp;
        This is what the EventViewer is shows you.&nbsp;&nbsp;
    </p>
    <ol>
        <li>
            <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/6-event-viewer-basics">Event Viewer Basics</a> (16 min)&nbsp; -
            Using the data in the tutorial example, we describe the basic funtionality of
            the Event Viewer, which is mostly about filtering events (by name, time,
            process, and text) as well as deciding which fields to display.&nbsp;&nbsp;&nbsp;
            Also shown are features for accessing the stacks associated with particular
            events and the ability to export the view as a CSV (Excel file) for further processing.
        </li>
        <li>
            <a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/7-using-event-viewer-in-aspnet-scenarios">The Event Viewer in ASP.NET Scenarios</a>
            (6 min) - ASP.NET is a common sceanrio for many server workloads, and ASP.NET
            can log ETW events that are very helpful in isolating the processing of one
            request from all the other processing that is happening on the server.&nbsp;&nbsp;
            In this video we demonstrate how to use these events to help in an
            investigation.&nbsp;
        </li>
    </ol>
    <h3>Using System.Diagnostics.Tracing.EventSource to Log Your Own Events</h3>
    <p>
        When doing any time based investigation, it is very useful to know what the program is doing at a &#39;high level&#39;, so that you can easily zoom into these logical regions and focus on just certain aspects of your applications performance.&nbsp;&nbsp; This is especially important in server scenarios as well any scnearios that use asynchronous I/O (because Async I/O makes it harder to use the stack of your program to do the same thing).&nbsp;&nbsp;&nbsp; There is a class in Version 4.5 of the .NET Framework called System.Diagnostics.Tracing.EventSource that lets you do just this.&nbsp; Using this class it is trivial to make your .NET program log ETW events with whatever payload you desire.&nbsp;&nbsp; These videos show you how.
    </p>
    <ol>
        <li><a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/8-generating-your-own-events-eventsources">Generating Your own Events with EventSource</a> (12 min).&nbsp; This video is an introduction to using EventSource, showing you how to write the code, how to turn on your event source and how to view the resulting log messages in the PerfView Event Viewer (see Event Viewer Basics above).&nbsp;&nbsp;&nbsp; There is also a <a href="http://blogs.msdn.com/b/vancem/archive/2012/07/09/logging-your-own-etw-events-in-c-system-diagnostics-tracing-eventsource.aspx">companion blog entry</a> that has links to a version of EventSource that works on versions of the .NET Framework before V4.5.&nbsp; </li>
    </ol>
    <h2>Memory Investigations</h2>
    <p>
        PerfView&#39;s capabilities break into two rough categories, time (based on ETW
        events), and memory (based on memory snapshots).&nbsp;&nbsp; In this section we
        go into detail on how to use PerfView to do a Memory Performance investigation.&nbsp;
    </p>
    <ol>
        <li>
            &nbsp;<a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/9-net-memory-investigation-basics-of-gc-heap-snapshots">Basics of GC Heap Snapshots</a> (9 min) - The first
            step in doing&nbsp; .NET Memory investigation is first determine whether .NET
            Memory is your problem and take a heap snapshot.&nbsp;&nbsp; This tutorial shows
            you how to determine how much of your process&#39;s memory is GC heap and (if that
            is your problem) shows you how to take a snapshot of the GC heap.&nbsp;
        </li>
        <li><a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/tutorial-10-investigating-net-heap-memory-leaks-part1-collecting-data">Investigating .NET Heap Memory Leaks: Part 1: Collecting the Data</a> (8 min) This is the first of a two part video of step-by-step instructions for using PerfView to investigate a &#39;Leak&#39; in the .NET GC heap.&nbsp; This first part goes through the mechanics of collecting the data which involves taking two heap snapshots at appropriate times.&nbsp; </li>
        <li><a href="https://docs.microsoft.com/en-us/shows/perfview-tutorial/tutorial-11-investigating-net-heap-memory-leaks-part2-analyzing-data">Investigation .NET Heap Memory Leaks: Part 2: Analyzing the Data </a>(11 min).&nbsp; In this second part we take the two snapshots collected in part 1 and walk though the mechanics of doing a &#39;diff&#39; of the two memory heaps to determine how the heap grew between the two points in time.&nbsp; This lets us home in on places where we were not dropping references to objects (which caused them to &#39;leak&#39;).&nbsp; </li>
    </ol>
    <script>
      // Set theme based on user preference
      const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
      document.documentElement.setAttribute('data-theme', prefersDark ? 'dark' : 'light');
    </script>
  </body>
</html>
